package com.mini.game.bus.resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.Comparator;
import java.util.List;

@Service
public class ResourceService {
    @Autowired
    private List<IResourceData> resourceDataList;

    @PostConstruct
    public void init() {
        resourceDataList.sort(Comparator.comparingInt(IResourceData::order));
        for (IResourceData e : resourceDataList) {
            e.loadResource();
        }
    }

}
